{include file="public/header" /}
<style>
    .arrow-right::before {
        content: "→"; /* 使用HTML实体字符作为箭头 */
        margin-right: 5px;
        color: #5cb85c; /* 可选：设置箭头颜色 */
    }
    .user-chain-item {
        padding-left: 20px;
    }
</style>
        {include file="public/tophead"}
<body class="gray-bg">
<div class="wrapper wrapper-content">

<div class="container">
    <h1 class="page-header">团队链条（上级）</h1>
    
    <!-- 使用 panel 和 list-group 展示用户链条 -->
    <div class="panel panel-default">
        <div class="panel-body">
            <ul class="list-group">
                <?php 
                $isFirst = true; // 用于控制是否显示箭头
                foreach ($data as $user): 
                    $arrowClass = !$isFirst ? 'arrow-right' : ''; // 如果不是第一个元素则添加箭头
                    $isFirst = false; // 第一个元素后，开启箭头显示
                ?>
                    <li class="list-group-item user-chain-item <?php echo $arrowClass; ?>">
                        ID: <strong><?php echo $user['id']; ?></strong> &nbsp; &nbsp;
                        昵称: <strong><?php echo htmlspecialchars($user['name']); ?></strong> &nbsp; &nbsp;
                        用户等级: <strong><?php echo $user['level_text']; ?></strong> &nbsp; &nbsp;
                        {if condition="$user['team_out']"}
                        <strong style="color: red;">已脱离上级团队</strong>
                        {/if}

                        <div class="btn btn-primary btn-xs" onClick="add('{:url('member/index',['search'=>'id','name'=>$user['id']])}')" >
                            查看用户详情
                        </div>
                    </li>
                <?php endforeach; ?>
            </ul>
        </div>
    </div>
</div>


</div>
{include file="public/footer" /}
{include file="public/bottom" /}
